﻿<%@ Page Language="C#" MasterPageFile="~/Demo.Master" AutoEventWireup="true" 
CodeBehind="WeekCalendarExample.aspx.cs" Theme="Theme1"
Inherits="WebApplication.Sample.Contrib.WeekCalendar.WeekCalendarExample" Title="Untitled Page" %>

<%@ Register assembly="JQueryControlExtender.Contrib" namespace="JQueryControlExtender.Contrib.WeekCalendar" tagPrefix="jquerycontrols" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="jquery.weekcalendar.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    <Scripts>
        <asp:ScriptReference Path="jquery.weekcalendar.js" />
    </Scripts>
    </asp:ScriptManagerProxy>
    <asp:Panel ID="Panel1" runat="server">
    </asp:Panel>
    
    <jquerycontrols:WeekCalendarControl ID="WeekCalendarControl1" runat="server" 
        TargetControlID="Panel1" Height="500" ShowButtons="false" DateFormat=" " TimeslotsPerHour="1" TimeSeparator="/" TimeFormat="h:ia">
        <ClientEventRender>
        function(calEvent, $event) {
            if(calEvent.end.getTime() < new Date().getTime()) {
                $event.css("backgroundColor", "#aaa");
                $event.find(".time").css({"backgroundColor": "#999", "border":"1px solid #888"});
            }
		}
        </ClientEventRender>
        </jquerycontrols:WeekCalendarControl>
         
    <script language="javascript" type="text/javascript">
    function HandleNewEvent(sender, calEvent, $event) {
        alert("Hello "+calEvent.start);
        //$(sender).weekCalendar("removeUnsavedEvents");
        //$calendar.weekCalendar("updateEvent", calEvent);
    }
        function HandleClickEvent(sender, calEvent, $event) {
        alert("Click "+calEvent.start);
        //$(sender).weekCalendar("removeUnsavedEvents");
        //$calendar.weekCalendar("updateEvent", calEvent);
    }
    </script>

</asp:Content>
